package com.zycfc.zsf.boot.swagger2;

import org.springframework.boot.context.properties.*;
import java.util.*;

@ConfigurationProperties(prefix = "zycfc.boot.logback")
public class TraceProperties
{
    public static final String PREFIX = "zycfc.boot.logback";
    public static final String DEFAULT_INVALID_CHARS = "[^A-Za-z0-9_-]";
    public static final String DEFAULT_URL_PATTERN = "/*";
    private static final String DEFAULT_FILTER_NAME = "zycfcTraceFilter";
    private static final int DEFAULT_ORDER = -99999;
    private boolean enabled;
    private String filterName;
    private String[] urlPatterns;
    private String[] ignoreUrls;
    private String traceId;
    private int traceIdMaxLength;
    private String invalidChars;
    private int order;
    
    public TraceProperties() {
        this.enabled = true;
        this.filterName = "zycfcTraceFilter";
        this.traceId = "ZYCFC-TRACE-ID";
        this.traceIdMaxLength = 16;
        this.invalidChars = "[^A-Za-z0-9_-]";
        this.order = -99999;
    }
    
    public boolean isEnabled() {
        return this.enabled;
    }
    
    public String getFilterName() {
        return this.filterName;
    }
    
    public String[] getUrlPatterns() {
        return this.urlPatterns;
    }
    
    public String[] getIgnoreUrls() {
        return this.ignoreUrls;
    }
    
    public String getTraceId() {
        return this.traceId;
    }
    
    public int getTraceIdMaxLength() {
        return this.traceIdMaxLength;
    }
    
    public String getInvalidChars() {
        return this.invalidChars;
    }
    
    public int getOrder() {
        return this.order;
    }
    
    public void setEnabled(final boolean enabled) {
        this.enabled = enabled;
    }
    
    public void setFilterName(final String filterName) {
        this.filterName = filterName;
    }
    
    public void setUrlPatterns(final String[] urlPatterns) {
        this.urlPatterns = urlPatterns;
    }
    
    public void setIgnoreUrls(final String[] ignoreUrls) {
        this.ignoreUrls = ignoreUrls;
    }
    
    public void setTraceId(final String traceId) {
        this.traceId = traceId;
    }
    
    public void setTraceIdMaxLength(final int traceIdMaxLength) {
        this.traceIdMaxLength = traceIdMaxLength;
    }
    
    public void setInvalidChars(final String invalidChars) {
        this.invalidChars = invalidChars;
    }
    
    public void setOrder(final int order) {
        this.order = order;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof TraceProperties)) {
            return false;
        }
        final TraceProperties other = (TraceProperties)o;
        if (!other.canEqual(this)) {
            return false;
        }
        if (this.isEnabled() != other.isEnabled()) {
            return false;
        }
        final Object this$filterName = this.getFilterName();
        final Object other$filterName = other.getFilterName();
        Label_0078: {
            if (this$filterName == null) {
                if (other$filterName == null) {
                    break Label_0078;
                }
            }
            else if (this$filterName.equals(other$filterName)) {
                break Label_0078;
            }
            return false;
        }
        if (!Arrays.deepEquals(this.getUrlPatterns(), other.getUrlPatterns())) {
            return false;
        }
        if (!Arrays.deepEquals(this.getIgnoreUrls(), other.getIgnoreUrls())) {
            return false;
        }
        final Object this$traceId = this.getTraceId();
        final Object other$traceId = other.getTraceId();
        Label_0147: {
            if (this$traceId == null) {
                if (other$traceId == null) {
                    break Label_0147;
                }
            }
            else if (this$traceId.equals(other$traceId)) {
                break Label_0147;
            }
            return false;
        }
        if (this.getTraceIdMaxLength() != other.getTraceIdMaxLength()) {
            return false;
        }
        final Object this$invalidChars = this.getInvalidChars();
        final Object other$invalidChars = other.getInvalidChars();
        if (this$invalidChars == null) {
            if (other$invalidChars == null) {
                return this.getOrder() == other.getOrder();
            }
        }
        else if (this$invalidChars.equals(other$invalidChars)) {
            return this.getOrder() == other.getOrder();
        }
        return false;
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof TraceProperties;
    }
    
    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * 59 + (this.isEnabled() ? 79 : 97);
        final Object $filterName = this.getFilterName();
        result = result * 59 + (($filterName == null) ? 43 : $filterName.hashCode());
        result = result * 59 + Arrays.deepHashCode(this.getUrlPatterns());
        result = result * 59 + Arrays.deepHashCode(this.getIgnoreUrls());
        final Object $traceId = this.getTraceId();
        result = result * 59 + (($traceId == null) ? 43 : $traceId.hashCode());
        result = result * 59 + this.getTraceIdMaxLength();
        final Object $invalidChars = this.getInvalidChars();
        result = result * 59 + (($invalidChars == null) ? 43 : $invalidChars.hashCode());
        result = result * 59 + this.getOrder();
        return result;
    }
    
    @Override
    public String toString() {
        return "TraceProperties(enabled=" + this.isEnabled() + ", filterName=" + this.getFilterName() + ", urlPatterns=" + Arrays.deepToString(this.getUrlPatterns()) + ", ignoreUrls=" + Arrays.deepToString(this.getIgnoreUrls()) + ", traceId=" + this.getTraceId() + ", traceIdMaxLength=" + this.getTraceIdMaxLength() + ", invalidChars=" + this.getInvalidChars() + ", order=" + this.getOrder() + ")";
    }
}
